Skip to content

Handle empty left and right tensor indices - #331

Merged
Jutho merged 1 commit into
QuantumKitHub:mainfrom
gezerui888:empty-split-indices
Nov 25, 2026
Merged

Jutho merged 1 commit into
QuantumKitHub:mainfrom
gezerui888:empty-split-indices

Conversation

@gezerui888

Copy link
Copy Markdown
Contributor

Fixes #325.

I made the tensor parser recognize the expression Julia uses for r[;] when both index lists are empty. This lets a matrix trace use the same split-index syntax as other contractions.

I added tests for a zero-dimensional result on the left and right of an assignment and for the parser’s handling of higher-dimensional concatenation.

cc @lkdvos

@lkdvos lkdvos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this, this looks good to me but it would be great if maybe @Jutho could add a second opinion

@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/indexnotation/analyzers.jl 89.02% <100.00%> (+0.13%) ⬆️
src/indexnotation/preprocessors.jl 89.09% <100.00%> (+0.20%) ⬆️
src/indexnotation/verifiers.jl 95.90% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Jutho

Jutho commented Nov 25, 2026

Copy link
Copy Markdown
Member

Looks good to me as well; thanks. The different ways the [] expressions are parsed keeps amazing me.

@Jutho
Jutho merged commit 51837f8 into QuantumKitHub:main Nov 25, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support r[;] as a tensor without indices in index notation

3 participants